package com.huawei.appgallery.search.ui.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.search.ui.cardbean.ContentNormalCardItemBean;
import huawei.widget.HwTextView;
import java.util.ArrayList;
import java.util.List;
import o.cgz;
import o.cuv.b;
import o.dof;
import o.CollectCheck;
import o.eqx;

public class CententNormalItemCard extends BaseCompositeItemCard {
    private View ʻ;
    private ImageView ʽ;
    private HwTextView ˋ;
    private List<HwTextView> ॱॱ;
    private HwTextView ᐝ;

    public CententNormalItemCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ˏ((ImageView) view.findViewById(b.ˊˋ));
        ॱ((TextView) (HwTextView) view.findViewById(b.ॱʽ));
        ˊ((TextView) (HwTextView) view.findViewById(b.ˌ));
        this.ˋ = (HwTextView) view.findViewById(b.ˏ);
        this.ᐝ = (HwTextView) view.findViewById(b.ˎ);
        this.ʽ = (ImageView) view.findViewById(b.ˏˏ);
        this.ʻ = view.findViewById(b.ʽ);
        this.ॱॱ = new ArrayList(3);
        this.ॱॱ.add(0, (HwTextView) view.findViewById(b.ˍ));
        this.ॱॱ.add(1, (HwTextView) view.findViewById(b.ˎˏ));
        this.ॱॱ.add(2, (HwTextView) view.findViewById(b.ͺॱ));
        ʽ(view);
        return this;
    }

    public void w_() {
        eqx.ˏ(ʼॱ(), this.ˊᐝ.ॱˌ(), "image_default_icon");
    }

    public void ˏ(CardBean cardBean) {
        if (cardBean instanceof ContentNormalCardItemBean) {
            super.ˏ(cardBean);
            ContentNormalCardItemBean contentNormalCardItemBean = (ContentNormalCardItemBean) cardBean;
            if (dof.ʽ(contentNormalCardItemBean.ˊ())) {
                this.ˋ.setVisibility(4);
                this.ᐝ.setVisibility(4);
            } else {
                this.ˋ.setText(contentNormalCardItemBean.ˊ());
                this.ˋ.setVisibility(0);
                this.ᐝ.setVisibility(0);
            }
            if (!CollectCheck.isEmpty(contentNormalCardItemBean.ॱ())) {
                for (int i = 0; i < contentNormalCardItemBean.ॱ().size(); i++) {
                    if (!dof.ʽ((String) contentNormalCardItemBean.ॱ().get(i))) {
                        ((HwTextView) this.ॱॱ.get(i)).setText((CharSequence) contentNormalCardItemBean.ॱ().get(i));
                    }
                }
            }
            if (ˎ()) {
                this.ʽ.setVisibility(8);
                if (contentNormalCardItemBean.ॱㆍ()) {
                    this.ʻ.setVisibility(8);
                    return;
                } else {
                    this.ʻ.setVisibility(0);
                    return;
                }
            }
            this.ʽ.setVisibility(0);
            this.ʻ.setVisibility(8);
        }
    }
}
